import axios from 'axios'

export const API = axios.create({
  baseURL: process.env.VUE_APP_BASE_API,
  withCredentials: false
})

export const setHeader = (value, key = 'Authorization') => {
  API.defaults.headers.common[key] = `Bearer ${value}`
}

export const removeHeader = key => {
  delete API.defaults.headers.common[key]
}
